//
//  WBDemoViewController.swift
//  weibo
//
//  Created by z先生 on 17/1/6.
//  Copyright © 2017年 SZT. All rights reserved.
//

import UIKit

class WBDemoViewController: WBBaseViewController {

    override func viewDidLoad(){
        
        super.viewDidLoad()
        
        title = "第\(navigationController?.childViewControllers.count ?? 0)"
    }
    
    @objc func showNext(){
        
        let vc = WBDemoViewController()
        
        navigationController?.pushViewController(vc, animated: true)
        
    }

}

extension WBDemoViewController{
    
    override func setupUI(){
        
        super.setupUI()
//        navigationItem.rightBarButtonItem = UIBarButtonItem(title: "下一个", style: .plain, target: self, action: #selector(showNext))
//        let btn = UIButton.cz_textButton("下一个", fontSize: 16, normalColor: UIColor.blue, highlightedColor: UIColor.orange)
//        
//        btn?.addTarget(self, action: #selector(showNext), for: .touchUpInside)
//        
//        navigationItem.rightBarButtonItem = UIBarButtonItem(customView: btn!)

        navItem.rightBarButtonItem = UIBarButtonItem(title: "下一个", target: self, action: #selector(showNext))
    }
}
